package cn.pomelo;
import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class Hello {
    public static void main(String[] args) {
        Long start = System.currentTimeMillis();
        System.out.println("开始运行");
        File csv = new File("D:\\tmp\\test\\all.csv"); // CSV文件路径
        BufferedReader br = null;
        try {
            br = new BufferedReader(new FileReader(csv));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        String line = "";
        String everyLine = "";
        try {
            List<String> allString = new ArrayList<>();
            while ((line = br.readLine()) != null) { // 读取到的内容
                everyLine = line;
//                System.out.println(everyLine);
                allString.add(everyLine);
            }
            System.out.println("csv表格中所有行数：" + allString.size());
        } catch (IOException e) {
            e.printStackTrace();
        }
        Long end = System.currentTimeMillis();
        System.out.println("花费时间为：" + (end - start) + "ms");
    }
}
